<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Tomcat优化指南 - 专业性能调优手册</title>
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', 'Noto Serif SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            color: #333;
            line-height: 1.8;
            background-color: #f9fafb;
        }
        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 20px;
        }
        .hero {
            background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
            color: white;
            padding: 100px 0;
            position: relative;
            overflow: hidden;
        }
        .hero-content {
            position: relative;
            z-index: 2;
        }
        .hero-title {
            font-size: 3.5rem;
            font-weight: 700;
            margin-bottom: 1.5rem;
            line-height: 1.2;
        }
        .hero-subtitle {
            font-size: 1.5rem;
            font-weight: 300;
            max-width: 800px;
            margin-bottom: 2rem;
            opacity: 0.9;
        }
        .hero-bg {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-image: url('https://cdn.nlark.com/yuque/0/2024/png/21449790/1723086773767-9f139f15-1271-4997-b554-d58217e98d7c.png');
            background-size: cover;
            background-position: center;
            opacity: 0.15;
            z-index: 1;
        }
        .card {
            background: white;
            border-radius: 12px;
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            overflow: hidden;
        }
        .card:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
        .card-header {
            padding: 1.5rem;
            border-bottom: 1px solid #eee;
            font-weight: 600;
            font-size: 1.25rem;
            color: #1e3a8a;
        }
        .card-body {
            padding: 1.5rem;
        }
        .section-title {
            font-size: 2.25rem;
            font-weight: 700;
            color: #1e3a8a;
            margin-bottom: 2rem;
            position: relative;
            padding-bottom: 0.5rem;
        }
        .section-title:after {
            content: "";
            position: absolute;
            bottom: 0;
            left: 0;
            width: 80px;
            height: 4px;
            background: linear-gradient(90deg, #3b82f6, #9333ea);
            border-radius: 2px;
        }
        .code-block {
            background: #1e293b;
            color: #f8fafc;
            border-radius: 8px;
            padding: 1.5rem;
            overflow-x: auto;
            font-family: 'Courier New', Courier, monospace;
            margin: 1.5rem 0;
        }
        .code-block pre {
            margin: 0;
        }
        .nav-item {
            padding: 0.75rem 1rem;
            border-radius: 8px;
            transition: all 0.2s ease;
            color: #4b5563;
            font-weight: 500;
        }
        .nav-item:hover {
            color: #1e40af;
            background-color: #eff6ff;
        }
        .nav-item.active {
            color: #1e40af;
            background-color: #dbeafe;
        }
        .icon-circle {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 1rem;
            flex-shrink: 0;
            background: linear-gradient(135deg, #3b82f6, #6366f1);
            color: white;
        }
        .feature-box {
            display: flex;
            margin-bottom: 2rem;
        }
        .feature-content h3 {
            font-size: 1.25rem;
            font-weight: 600;
            color: #1e40af;
            margin-bottom: 0.5rem;
        }
        .table-container {
            overflow-x: auto;
            margin: 2rem 0;
        }
        table {
            width: 100%;
            border-collapse: collapse;
            border-radius: 8px;
            overflow: hidden;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        }
        th {
            background-color: #3b82f6;
            color: white;
            padding: 1rem;
            text-align: left;
            font-weight: 600;
        }
        td {
            padding: 1rem;
            border-bottom: 1px solid #eee;
        }
        tr:nth-child(even) {
            background-color: #f8fafc;
        }
        tr:hover {
            background-color: #eff6ff;
        }
        .diagram-container {
            background: white;
            border-radius: 12px;
            padding: 1.5rem;
            margin: 2rem 0;
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
        }
        .floating-nav {
            position: sticky;
            top: 40px;
        }
        .tag {
            display: inline-block;
            padding: 0.25rem 0.75rem;
            border-radius: 9999px;
            font-size: 0.75rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin-right: 0.5rem;
            margin-bottom: 0.5rem;
        }
        .tag-primary {
            background-color: #dbeafe;
            color: #1e40af;
        }
        .tag-secondary {
            background-color: #e9d5ff;
            color: #7e22ce;
        }
        .tag-success {
            background-color: #dcfce7;
            color: #166534;
        }
        .image-container {
            margin: 2rem 0;
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
        }
        .image-container img {
            display: block;
            width: 100%;
            height: auto;
        }
        .highlight {
            background-color: #fef3c7;
            padding: 2px 4px;
            border-radius: 4px;
            font-weight: 500;
        }
    </style>
</head>
<body>
    <!-- Hero Section -->
    <section class="hero">
        <div class="hero-bg"></div>
        <div class="container">
            <div class="hero-content">
                <h1 class="hero-title">Tomcat性能优化权威指南</h1>
                <p class="hero-subtitle">探索企业级Java应用服务器的深度调优策略，从配置优化到集群部署，全面提升系统性能和稳定性</p>
                <div class="flex flex-wrap gap-4">
                    <span class="tag tag-primary">性能调优</span>
                    <span class="tag tag-secondary">高并发</span>
                    <span class="tag tag-success">最佳实践</span>
                </div>
            </div>
        </div>
    </section>

    <div class="container py-12">
        <div class="flex flex-col lg:flex-row gap-8">
            <!-- Navigation -->
            <div class="w-full lg:w-1/4">
                <div class="card floating-nav">
                    <div class="card-header">
                        <i class="fas fa-bookmark mr-2"></i>导航目录
                    </div>
                    <div class="card-body">
                        <nav>
                            <ul class="space-y-2">
                                <li><a href="#intro" class="nav-item active"><i class="fas fa-play mr-2"></i>简介</a></li>
                                <li><a href="#architecture" class="nav-item"><i class="fas fa-sitemap mr-2"></i>整体架构</a></li>
                                <li><a href="#cluster" class="nav-item"><i class="fas fa-network-wired mr-2"></i>集群和负载均衡</a></li>
                                <li><a href="#principles" class="nav-item"><i class="fas fa-lightbulb mr-2"></i>优化原则</a></li>
                                <li><a href="#configuration" class="nav-item"><i class="fas fa-cog mr-2"></i>配置优化</a></li>
                                <li><a href="#logging" class="nav-item"><i class="fas fa-clipboard-list mr-2"></i>日志管理</a></li>
                                <li><a href="#monitoring" class="nav-item"><i class="fas fa-chart-line mr-2"></i>监控策略</a></li>
                            </ul>
                        </nav>
                    </div>
                </div>
            </div>

            <!-- Main Content -->
            <div class="w-full lg:w-3/4">
                <!-- Introduction Section -->
                <section id="intro" class="mb-16">
                    <h2 class="section-title">Tomcat如何优化</h2>
                    <div class="card">
                        <div class="card-body">
                            <p class="mb-6">作为一个成熟的Java应用服务器，Tomcat在企业级应用中扮演着至关重要的角色。随着互联网和信息技术的不断发展，企业和用户对系统的响应速度和稳定性有了更高的期望，因此，优化Tomcat的性能成为开发人员必须掌握的技能之一。</p>
                            
                            <div class="image-container">
                                <img src="https://cdn.nlark.com/yuque/0/2024/png/21449790/1723086621559-20213930-4889-44db-afed-cca4a2d9753e.png" alt="Tomcat优化场景">
                            </div>
                            
                            <p class="mb-4">想象一下，当您登录一个电商网站，页面加载速度缓慢，您会有什么样的体验？多半会感到沮丧，甚至可能离开网站。相反，一个响应迅速的网站可以极大提升用户体验，增加用户粘性和转换率。在这种情况下，Tomcat的性能优化就是提升用户体验的关键一环。优化Tomcat不仅能提升响应速度、提高吞吐量，还能显著降低资源消耗，为企业节省成本。</p>
                            
                            <p>在实际的工作场景中，我们常常面临不同的挑战：服务器响应过慢、内存消耗过高、网络吞吐不足，甚至是系统崩溃等。这些问题的根源往往出在服务器配置不当或应用设计不合理上。通过合理的优化策略，我们可以有效地提高系统的可靠性和可维护性，